package Job.it.it;

public class IT {
    private String name;
    private int age;
    private String direction;
    private int age_limit;
    private String unit;
    private String duty;

    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getAge() {
        return age;
    }
    public void setAge(int age) {
        if (age >= 15){
            this.age = age;
        }else {
            throw new RuntimeException("年龄必须满15岁!!!");
        }

    }
    public String getDirection() {
        return direction;
    }
    public int getAge_limit() {
        return age_limit;
    }
    public void setAge_limit(int age_limit) {
        this.age_limit = age_limit;
    }
    public String getUnit() {
        return unit;
    }
    public void setUnit(String unit) {
        this.unit = unit;
    }
    public String getDuty() {
        return duty;
    }
    public void setDuty(String duty) {
        this.duty = duty;
    }

    public IT(String name, int age, int age_limit, String unit, String duty) {
        this.name = name;
        this.age = age;
        this.age_limit = age_limit;
        this.direction = "IT";
        this.unit = unit;
        this.duty = duty;
    }

    public IT() {
    }

    @Override
    public String toString() {
        return "IT{" +
                "姓名='" + name + '\'' +
                ", 年龄=" + age +
                ", 技术方向=" + direction +
                ", 工作年限=" + age_limit +
                ", 工作单位='" + unit + '\'' +
                ", 职务='" + duty + '\'' +
                '}';
    }

}
